<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <!-- start: Meta -->
    <meta charset="utf-8">
    <title>祥安消防系统</title>
    <meta name="description" content="Bootstrap Metro Dashboard">
    <meta name="author" content="Dennis Ji">
    <meta name="keyword"
          content="Metro, Metro UI, Dashboard, Bootstrap, Admin, Template, Theme, Responsive, Fluid, Retina">
    <!-- end: Meta -->

    <!-- start: Mobile Specific -->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- end: Mobile Specific -->

    <!-- start: CSS -->
    <link id="bootstrap-style" href="css/bootstrap.min.css" rel="stylesheet">
    <link href="css/bootstrap-responsive.min.css" rel="stylesheet">
    <link id="base-style" href="css/style.css" rel="stylesheet">
    <link id="base-style-responsive" href="css/style-responsive.css"
          rel="stylesheet">
    <link
            href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800&subset=latin,cyrillic-ext,latin-ext'
            rel='stylesheet' type='text/css'>
    <!-- end: CSS -->


    <!-- The HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
    <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <link id="ie-style" href="css/ie.css" rel="stylesheet">
    <![endif]-->

    <!--[if IE 9]>
    <link id="ie9style" href="css/ie9.css" rel="stylesheet">
    <![endif]-->

    <!-- start: Favicon -->
    <link rel="shortcut icon" href="img/favicon.ico">
    <!-- end: Favicon -->




</head>
<body>
<!-- start: JavaScript-->

<script src="js/jquery-1.9.1.min.js"></script>
<script src="js/jquery-migrate-1.0.0.min.js"></script>

<script src="js/jquery-ui-1.10.0.custom.min.js"></script>

<script src="js/jquery.ui.touch-punch.js"></script>

<script src="js/modernizr.js"></script>

<script src="js/bootstrap.min.js"></script>

<script src="js/jquery.cookie.js"></script>

<script src='js/fullcalendar.min.js'></script>

<script src='js/jquery.dataTables.min.js'></script>

<script src="js/excanvas.js"></script>
<script src="js/jquery.flot.js"></script>
<script src="js/jquery.flot.pie.js"></script>
<script src="js/jquery.flot.stack.js"></script>
<script src="js/jquery.flot.resize.min.js"></script>

<script src="js/jquery.chosen.min.js"></script>

<script src="js/jquery.uniform.min.js"></script>

<script src="js/jquery.cleditor.min.js"></script>

<script src="js/jquery.noty.js"></script>

<script src="js/jquery.elfinder.min.js"></script>

<script src="js/jquery.raty.min.js"></script>

<script src="js/jquery.iphone.toggle.js"></script>

<script src="js/jquery.uploadify-3.1.min.js"></script>

<script src="js/jquery.gritter.min.js"></script>

<script src="js/jquery.imagesloaded.js"></script>

<script src="js/jquery.masonry.min.js"></script>

<script src="js/jquery.knob.modified.js"></script>

<script src="js/jquery.sparkline.min.js"></script>

<script src="js/counter.js"></script>

<script src="js/retina.js"></script>

<script src="js/custom.js"></script>

<script>

    $(document).ready(function(){

        if($("#abc").val()==0){
            $("#abc").val(${bid});
        }


    });

    function submitQuestion() {


        if($("#ylwtcheck").is(':checked')){

            $("#type").val("维护遗留");
        }

        $("#questionForm").submit();

        var pare=window.opener;

        if(pare!=null)
        {

            var $what=$(pare.document.getElementById("company"));



            if($what!=null) {
                var name = $what.find("option:selected");

                var $tbody=$(pare.document.getElementById("tablebody"));

                $.post("${pageContext.request.contextPath}/questionAction", {company:name.val(),type:$("#type").val()},
                    function(data){
                        //tbody清空
                        $tbody.empty();
                        //4 返回json数组对象,对其遍历
                        $.each( data, function(i, json){
                            var flag = json["mustDo"];
                            if(flag==1){
                                var str = "<td class='center'>是</td>";
                            }else {
                                var str = "<td class='center'>否</td>";
                            }
                            // 每次遍历创建一个option对象
                            var $tr = $("<tr><td>"+json["questionName"]+"</td><td class='center'>"+json["insertTime"]+"</td>" +
                                "<td class='center'>"+json["dutyPeople"]+"</td><td class='center'>"+json["isfinish"]+"</td>" +str+
                                "<td class=\"center\">\n" +
                                "                                                <a target='_blank' class=\"btn btn-info\" " +
                                "href=\"/Ques_editQuestion?questionId="+json["id"]+"\">\n" +
                                "                                                    <i class=\"halflings-icon white edit\"></i>\n" +
                                "                                                </a>\n" +
                                "                                            </td></tr>");

                            //并添加到select对象
                            $tbody.append($tr);

                        });
                        alert("添加成功！")
                        window.close();
                    },"json");









            }
        }


    }

    $(document).ready(function() {


        if("<s:property value="#type=='维护'?'1':'2'"/>"=='1'||$("#type").val()=='维护'||$("#type").val()=='维护遗留'){

            $("#whyldiv").removeAttr("hidden");
        }

        <%--loadSelect("3","pos","asff", "<s:property value="#taskQuestion.dutyPeople"/>");--%>

        // var $select = $("#pos").children();
        //
        // $select.change(function () {
        //     $("#duty").val($("select option:selected").text());
        // });

        $("#missionText").cleditor({width:$("#boxw").width()}
        );
        var pare=window.opener;

        if(pare!=null)
        {
            var type=pare.document.getElementById("type");
            $("#type").val(type.value);

            var what=pare.document.getElementById("company");
            var index=what.selectedIndex;
            if(what!=null) {
                $("#company").text(what.options[index].text);
                $("#companyHidden").val(what.options[index].text);

            }
        }

    });


</script>
<!-- end: JavaScript-->

<!-- start: Header -->
<%@include file="header.jsp"%>
<div class="container-fluid-full">
    <div class="row-fluid">

        <!-- start: Main Menu -->
        <%@include file="mainmenu.jsp"%>
        <!-- start: Content -->
        <div id="content" class="span10">
            <ul class="breadcrumb">
                <li><i class="icon-home"></i> <a href="index.html">主页</a> <i
                        class="icon-angle-right"></i></li>
                <li><a href="#">任务情况</a></li>
            </ul>

            <div class="row-fluid sortable">
                <div class="box span12">
                    <div class="box-header" data-original-title>
                        <h2>
                            <i class="halflings-icon white edit"></i><span class="break"></span>问题添加
                        </h2>
                        <div class="box-icon">
                            <a href="#" class="btn-setting"><i
                                    class="halflings-icon white wrench"></i></a> <a href="#"
                                                                                    class="btn-minimize"><i
                                class="halflings-icon white chevron-up"></i></a> <a href="#"
                                                                                    class="btn-close"><i class="halflings-icon white remove"></i></a>
                        </div>
                    </div>
                    <div class="box-content">
                        <form id="questionForm" class="form-horizontal" method="post" action="${pageContext.request.contextPath}/Ques_addQuestion?company=<s:property value="#company"/>">
                            <fieldset>
                                <input type="hidden"  id="abc" name="taskQuestion.id" value="<s:property value="#taskQuestion.id"/>">
                                <input type="hidden" id="type" name="taskQuestion.type" value="<s:property value="#taskQuestion.type"/>">
                                <div class="control-group">
                                    <label class="control-label"   style="text-align: left">*单位名称：</label>
                                    <div class="controls">
                                        <label id="company"><s:property value="#company"/><s:property value="#taskQuestion.companyName"/></label>
                                        <input id="companyHidden"  type="hidden" name="taskQuestion.companyName"
                                               value="<s:property value="#taskQuestion.companyName"/>">
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label class="control-label"  style="text-align: left">*问题名称</label>
                                    <div class="controls">
                                        <input class="input-xlarge focused" id="questionName" name="taskQuestion.questionName"
                                               value="<s:property value="#taskQuestion.questionName"/>" type="text" placeholder="请输入任务名称">
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label class="control-label" for="date01"  style="text-align: left">*记录时间</label>
                                    <div class="controls">
                                        <input type="text" class="input-xlarge datepicker" id="date01"
                                               value="<s:property value="#taskQuestion.insertTime"/>" name="taskQuestion.insertTime">
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label class="control-label"   style="text-align: left">*记录人</label>
                                    <div id="pos" class="controls">
                                        <select name="taskQuestion.dutyPeople">
                                            <s:iterator id="jc" value="#nameList" var="jc">
                                                <option value="<s:property value="#jc.dict_item_name"/>"
                                                        <s:if test="#jc.dict_item_name == #taskQuestion.dutyPeople">selected</s:if>>
                                                    <s:property value="#jc.dict_item_name"/></option>
                                            </s:iterator>
                                        </select>
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label class="control-label" style="text-align: left">*问题状态</label>
                                    <div class="controls">

                                        <select id="isfinish" name="taskQuestion.isfinish" >
                                            <option <s:if test="'材料未核准：核准中□/今日核准□/处理中□/已修复□' == #taskQuestion.isfinish">selected</s:if>>材料未核准：核准中□/今日核准□/处理中□/已修复□</option>
                                            <option <s:if test="'遗留：初次录入□/已发函□/函签字□/乙报材□/材签字□/乙报价□/报价签字□/今日修复□/已修复□' == #taskQuestion.isfinish">selected</s:if>>遗留：初次录入□/已发函□/函签字□/乙报材□/材签字□/乙报价□/报价签字□/今日修复□/已修复□</option>
                                            <option <s:if test="'甲材甲责：初次录入/□已发函□/函签字□/乙报材□/材签字□/乙报价□/报价签字□/今日修复□/已修复□' == #taskQuestion.isfinish">selected</s:if>>甲材甲责：初次录入/□已发函□/函签字□/乙报材□/材签字□/乙报价□/报价签字□/今日修复□/已修复□</option>
                                            <option <s:if test="'非材甲责：初次录入□/已发函□/函签字□/乙报材□/材签字□/乙报价□/报价签字□/今日修复□/已修复□' == #taskQuestion.isfinish">selected</s:if>>非材甲责：初次录入□/已发函□/函签字□/乙报材□/材签字□/乙报价□/报价签字□/今日修复□/已修复□</option>
                                            <option <s:if test="'甲材乙责: 初次录入□/已发函□/函签字□/发代购单□/代购签字□/今日修复□/已修复□' == #taskQuestion.isfinish">selected</s:if>>甲材乙责: 初次录入□/已发函□/函签字□/发代购单□/代购签字□/今日修复□/已修复□</option>
                                            <option <s:if test="'非材乙责：初次录入□/今日修复□/已完成□' == #taskQuestion.isfinish">selected</s:if>>非材乙责：初次录入□/今日修复□/已完成□</option>
                                            <option <s:if test="'乙材乙责乙购：初次录入□/采购中□/今日修复□/已完成□' == #taskQuestion.isfinish">selected</s:if>>乙材乙责乙购：初次录入□/采购中□/今日修复□/已完成□</option>
                                            <option <s:if test="'已处理' == #taskQuestion.isfinish">selected</s:if>>已处理</option>

                                        </select>

                                        <label>注意：必须将一个属性和一个状态对应写清楚，问题状态改变时请记录在‘状态及责任方变更纪录’。</label>
                                    </div>
                                    <%--<label>注意：问题状态改变时请记录在‘状态及责任方变更纪录’。</label>--%>

                                </div>


                                <div class="control-group">
                                    <label class="control-label"  style="text-align: left">*级别</label>
                                    <div class="controls">
                                        <select id="level" name="taskQuestion.level" >
                                            <option <s:if test="'A项' == #taskQuestion.level">selected</s:if>>A项</option>
                                            <option <s:if test="'B项' == #taskQuestion.level">selected</s:if>>B项</option>
                                            <option <s:if test="'C项' == #taskQuestion.level">selected</s:if>>C项</option>

                                        </select>
                                    </div>
                                </div>

                                <%--<div class="control-group">--%>
                                    <%--<label class="control-label"  style="text-align: left">*责任方</label>--%>
                                    <%--<div class="controls">--%>

                                        <%--<select id="gf" name="taskQuestion.gf" >--%>
                                            <%--<option <s:if test="'甲方处理' == #taskQuestion.gf">selected</s:if>>甲方处理</option>--%>
                                            <%--<option <s:if test="'乙方处理' == #taskQuestion.gf">selected</s:if>>乙方处理</option>--%>
                                            <%--<option <s:if test="'甲供材料' == #taskQuestion.gf">selected</s:if>>甲供材料</option>--%>

                                        <%--</select>--%>

                                        <%--<label>注意：责任方改变时请记录在‘状态及责任方变更纪录’。</label>--%>
                                    <%--</div>--%>

                                <%--</div>--%>


                                <div class="control-group">
                                    <label class="control-label"  style="text-align: left">*状态及责任方变更纪录（每次经手人及当时对应时间）</label>

                                    <div class="controls">
                                        <textarea style="width: 800px;height: 100px;" name="taskQuestion.ztjzrbgjl"><s:property value="#taskQuestion.ztjzrbgjl"/></textarea>
                                    </div>
                                </div>

                                <div class="control-group" id="whyldiv" hidden="hidden">
                                    <label class="checkbox inline">
                                        <input type="checkbox" id="ylwtcheck"  value="1"
                                        <s:property value="#taskQuestion.type==维护遗留?'checked':''"/>>是合同前期遗留问题
                                    </label>
                                </div>

                                <div class="control-group">
                                    <label class="control-label"  style="text-align: left">*未被处理原因</label>
                                    <div class="controls">
                                        <input class="input-xlarge focused" id="wbclyy" name="taskQuestion.wbclyy"
                                               value="<s:property value="#taskQuestion.wbclyy"/>" type="text" placeholder="请输入">
                                    </div>
                                </div>
                                <div class="control-group">

                                    <label class="checkbox inline">
                                        <input type="checkbox" id="1needc"  value="1" name="taskQuestion.needcl"
                                        <s:property value="#taskQuestion.needcl==1?'checked':''"/>>需要准备材料
                                    </label>

                                </div>
                                <%--<div class="control-group">--%>
                                    <%--<label class="control-label" style="text-align: left">*是否需要材料</label>--%>
                                    <%--<div class="controls">--%>
                                        <%--<label class="radio">--%>
                                            <%--<input type="radio" name="taskQuestion.needcl" id="aRadios1" value="是"--%>
                                            <%--<s:property value="#taskQuestion.needcl=='是'?'checked':''"/>>是--%>
                                        <%--</label>--%>
                                        <%--<div style="clear:both"></div>--%>
                                        <%--<label class="radio">--%>
                                            <%--<input type="radio" name="taskQuestion.needcl" id="aRadios2" value="否"--%>
                                            <%--<s:property value="#taskQuestion.needcl=='否'?'checked':''"/>>否--%>
                                        <%--</label>--%>
                                    <%--</div>--%>
                                <%--</div>--%>
                                <div class="control-group">
                                    <label class="control-label"  style="text-align: left">*所需材料辅料</label>
                                    <div class="controls">
                                        <input class="input-xlarge focused" id="sxcl" name="taskQuestion.sxcl"
                                               value="<s:property value="#taskQuestion.sxcl"/>" type="text" placeholder="请输入">
                                    </div>
                                </div>

                                <%--<div class="control-group">--%>
                                    <%--<label class="control-label"  style="text-align: left">*初始类型</label>--%>
                                    <%--<div class="controls">--%>
                                        <%--<select id="lx" name="taskQuestion.lx" >--%>
                                            <%--<option <s:if test="'合同遗留' == #taskQuestion.lx">selected</s:if>>合同遗留</option>--%>
                                            <%--<option <s:if test="'月检问题' == #taskQuestion.lx">selected</s:if>>月检问题</option>--%>
                                            <%--<option <s:if test="'常规维护' == #taskQuestion.lx">selected</s:if>>常规维护</option>--%>
                                            <%--<option <s:if test="'建议加装' == #taskQuestion.lx">selected</s:if>>建议加装</option>--%>
                                            <%--<option <s:if test="'建议整改' == #taskQuestion.lx">selected</s:if>>建议整改</option>--%>
                                            <%--<option <s:if test="'遗留建议加装' == #taskQuestion.lx">selected</s:if>>遗留建议加装</option>--%>
                                            <%--<option <s:if test="'硬伤问题' == #taskQuestion.lx">selected</s:if>>硬伤问题</option>--%>
                                            <%--&lt;%&ndash;<option <s:if test="'维护加装' == #taskQuestion.lx">selected</s:if>>维护加装</option>&ndash;%&gt;--%>
                                        <%--</select>--%>
                                    <%--</div>--%>
                                <%--</div>--%>


                                <div class="control-group">
                                    <label class="control-label"  style="text-align: left">*数量</label>
                                    <div class="controls">
                                        <input class="input-xlarge focused" id="sl" name="taskQuestion.sl"
                                               value="<s:property value="#taskQuestion.sl"/>" type="text" placeholder="请输入">
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label class="control-label"  style="text-align: left">*厂家</label>
                                    <div class="controls">
                                        <input class="input-xlarge focused" id="cj" name="taskQuestion.cj"
                                               value="<s:property value="#taskQuestion.cj"/>" type="text" placeholder="请输入">
                                    </div>
                                </div>


                                <div class="control-group">
                                    <label class="control-label"  style="text-align: left">*型径</label>
                                    <div class="controls">
                                        <input class="input-xlarge focused" id="xj" name="taskQuestion.xj"
                                               value="<s:property value="#taskQuestion.xj"/>" type="text" placeholder="请输入">
                                    </div>
                                </div>

                                <div class="control-group">
                                    <label class="control-label"  style="text-align: left">*辅材名称型径数量</label>
                                    <div class="controls">
                                        <input class="input-xlarge focused" id="fcmcxjsl" name="taskQuestion.fcmcxjsl"
                                               value="<s:property value="#taskQuestion.fcmcxjsl"/>" type="text" placeholder="请输入">
                                    </div>
                                </div>

                                <div class="control-group">
                                    <label class="control-label"  style="text-align: left">*工具型号</label>
                                    <div class="controls">
                                        <input class="input-xlarge focused" id="gjxh" name="taskQuestion.gjxh"
                                               value="<s:property value="#taskQuestion.gjxh"/>" type="text" placeholder="请输入">
                                    </div>
                                </div>

                                <div class="control-group">
                                    <label class="control-label"  style="text-align: left">*材料单价</label>
                                    <div class="controls">
                                        <input class="input-xlarge focused" id="cldj" name="taskQuestion.cldj"
                                               value="<s:property value="#taskQuestion.cldj"/>" type="text" placeholder="请输入">
                                    </div>
                                </div>

                                <div class="control-group">
                                    <label class="control-label"  style="text-align: left">*辅材单价</label>
                                    <div class="controls">
                                        <input class="input-xlarge focused" id="fldj" name="taskQuestion.fldj"
                                               value="<s:property value="#taskQuestion.fldj"/>" type="text" placeholder="请输入">
                                    </div>
                                </div>

                                <div class="control-group">
                                    <label class="control-label"  style="text-align: left">*人工报价</label>
                                    <div class="controls">
                                        <input class="input-xlarge focused" id="rgbj" name="taskQuestion.rgbj"
                                               value="<s:property value="#taskQuestion.rgbj"/>" type="text" placeholder="请输入">
                                    </div>
                                </div>

                                <div class="control-group">
                                    <label class="control-label"  style="text-align: left">*总报价</label>
                                    <div class="controls">
                                        <input class="input-xlarge focused" id="zj" name="taskQuestion.zj"
                                               value="<s:property value="#taskQuestion.zj"/>" type="text" placeholder="请输入">
                                    </div>
                                </div>

                                <div class="control-group">
                                    <label class="control-label"  style="text-align: left">*材料成本</label>
                                    <div class="controls">
                                        <input class="input-xlarge focused" id="clcb" name="taskQuestion.clcb"
                                               value="<s:property value="#taskQuestion.clcb"/>" type="text" placeholder="请输入">
                                    </div>
                                </div>

                                <div class="control-group">
                                    <label class="control-label"  style="text-align: left">*辅料成本</label>
                                    <div class="controls">
                                        <input class="input-xlarge focused" id="flcb" name="taskQuestion.flcb"
                                               value="<s:property value="#taskQuestion.flcb"/>" type="text" placeholder="请输入">
                                    </div>
                                </div>

                                <div class="control-group">
                                    <label class="control-label"  style="text-align: left">*材辅核准人</label>
                                    <div class="controls">
                                        <input class="input-xlarge focused" id="hzr" name="taskQuestion.hzr"
                                               value="<s:property value="#taskQuestion.hzr"/>" type="text" placeholder="请输入">
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label class="control-label" for="date01"  style="text-align: left">*材辅核准时间</label>
                                    <div class="controls">
                                        <input type="text" class="input-xlarge datepicker" id="hzsj"
                                               value="<s:property value="#taskQuestion.hzsj"/>" name="taskQuestion.hzsj">
                                    </div>
                                </div>

                                <div class="control-group">
                                    <label class="control-label"  style="text-align: left">*维修方法、人数及时间</label>
                                    <div class="controls">
                                        <input class="input-xlarge focused" id="wxfa" name="taskQuestion.wxfa"
                                               value="<s:property value="#taskQuestion.wxfa"/>" type="text" placeholder="请输入">
                                    </div>
                                </div>




                                <%--<div class="control-group">--%>
                                    <%--<label class="control-label"  style="text-align: left">*签字</label>--%>
                                    <%--<div class="controls">--%>
                                        <%--<select id="qz" name="taskQuestion.qz" >--%>
                                            <%--<option <s:if test="'甲方' == #taskQuestion.qz">selected</s:if>>有</option>--%>
                                            <%--<option <s:if test="'乙方' == #taskQuestion.qz">selected</s:if>>无</option>--%>

                                        <%--</select>--%>
                                    <%--</div>--%>
                                <%--</div>--%>




                                <div class="control-group">
                                    <label class="checkbox inline">
                                        <input type="checkbox" id="mustdo"  value="1" name="taskQuestion.mustDo"
                                        <s:property value="#taskQuestion.mustDo==1?'checked':''"/>>必须在本次任务中处理
                                    </label>
                                </div>

                                <label class="label-warning">位置以及自定义描述:</label>
                                <textarea  name="taskQuestion.details" style="width: 800px;height: 100px;"><s:property value="#taskQuestion.details"/></textarea>
                                <%--<div class="control-group hidden-phone">--%>
                                    <%--<div class="controls" style="margin-left: auto">--%>
                                        <%--<textarea id="missionText" name="taskQuestion.details" rows="3"><s:property value="#taskQuestion.details"/></textarea>--%>
                                    <%--</div>--%>
                                <%--</div>--%>

                            </fieldset>
                            <div class="form-actions">
                                <button class="btn btn-primary" onclick="submitQuestion()">保存</button>
                                <button class="btn">关闭</button>
                            </div>
                        </form>



                    </div>
                </div>
                <!--/span-->

            </div>

        </div>
        <!--/.fluid-container-->

        <!-- end: Content -->
    </div>
    <!--/#content.span10-->
</div>
<!--/fluid-row-->

<%@include file="footer.jsp"%>



</body>
</html>